package common;

import common.cell.*;

class Draw {
    public static function text(grid: GridImpl, x: Int, y: Int, z: Int, str: String, color: Int = 6): Array<Cell> {
        var ox = x;
        var cells = [];

        for (char in str.split("")) {
            if (char == "\n") {
                x = ox;
                y++;
            } else {
                var cell = new Cell(grid, x, y, z);
                cell.char = char;
                cell.color = color;

                grid.setCell(x++, y, z, cell, false);
                cells.push(cell);
            }
        }

        return cells;
    }

    public static function box(grid: GridImpl, x: Int, y: Int, z: Int, w: Int, h: Int, color: Int = 6): Array<Cell> {
        // TODO
        return [];
    }
}
